#include "Course.h"



Course::Course()
{
}

Course::Course(int id, string name, Teacher * teacher, string time, string site, string clazz,int rate)
	:Model(id, name)
{
	this->teacher = teacher;
	this->time = time;
	this->site = site;
	this->clazz = clazz;
	this->rate = rate;
}


Course::~Course()
{
}

Teacher * Course::getTeacher()
{
	return teacher;
}

map<int, Student*>& Course::getStudents()
{
	return students;
}

string Course::getTime()
{
	return time;
}

string Course::getSite()
{
	return site;
}

string Course::getClazz()
{
	return clazz;
}

void Course::setRate(int rate)
{
	this->rate = rate;
}

void Course::setTeacher(Teacher * teacher)
{
	this->teacher = teacher;
}

void Course::setTime(string time)
{
	this->time = time;
}

void Course::setClazz(string clazz)
{
	this->clazz = clazz;
}

void Course::setSite(string site)
{
	this->site = site;
}

void Course::addStudent(Student * student)
{
	students[student->getId()] = student;
}

void Course::deleteStudent(int studentId)
{
	map<int, Student*>::iterator it = students.find(studentId);
	if (it != students.end())
		students.erase(it);
}

int Course::getRate()
{
	return rate;
}
